package ru.ifmo.entities;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;

@javax.persistence.Table(name = "order", catalog = "NAMIR")
@Entity
public class OrderEntity {
    private int orderId;

    @javax.persistence.Column(name = "Order_ID")
    @Id
    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    private int flightId;

    @javax.persistence.Column(name = "Flight_ID")
    @Basic
    public int getFlightId() {
        return flightId;
    }

    public void setFlightId(int flightId) {
        this.flightId = flightId;
    }

    private int userId;

    @javax.persistence.Column(name = "User_ID")
    @Basic
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    private int economCount;

    @javax.persistence.Column(name = "Econom_count")
    @Basic
    public int getEconomCount() {
        return economCount;
    }

    public void setEconomCount(int economCount) {
        this.economCount = economCount;
    }

    private int bussinessCount;

    @javax.persistence.Column(name = "Bussiness_count")
    @Basic
    public int getBussinessCount() {
        return bussinessCount;
    }

    public void setBussinessCount(int bussinessCount) {
        this.bussinessCount = bussinessCount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        OrderEntity that = (OrderEntity) o;

        if (bussinessCount != that.bussinessCount) return false;
        if (economCount != that.economCount) return false;
        if (flightId != that.flightId) return false;
        if (orderId != that.orderId) return false;
        if (userId != that.userId) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = orderId;
        result = 31 * result + flightId;
        result = 31 * result + userId;
        result = 31 * result + economCount;
        result = 31 * result + bussinessCount;
        return result;
    }
}
